#!/bin/bash
#
# Simple script for adding current readings every 5 seconds
#
while [ 1 ]
do
        # Use NC to connect to the port and extract the information
        #
	TEXT=`/usr/bin/nc localhost 30000`
	TICKS=`echo $TEXT | awk '{ print $1 }'`
	EFFEKT=`echo $TEXT | awk '{ print $2 }'`

	/usr/bin/rrdtool update /rrd/energy/energy.rrd N:$EFFEKT
	/usr/bin/sleep 5s
done
